<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Phalanx Holding | Dashboard</title>

    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap 3.3.4 -->
    <link href="/one/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />    
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <!-- FontAwesome 4.3.0 -->
    <link href="/one/Public/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!--     <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
 -->    <!-- Ionicons 2.0.0 -->
    <link href="/one/Public/plugins/ionicons/ionicons.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="/one/Public/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />

    <!-- AdminLTE Skins. Choose a skin from the css/skins 
         folder instead of downloading all of them to reduce the load. -->
    <link href="/one/Public/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
       <!-- bootstrap wysihtml5 - text editor -->
    <link href="/one/Public/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />

    
    <!-- DATA TABLES -->
    <link href="/one/Public/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/one/Public/plugins/datatables/jquery.dataTables.css" rel="stylesheet" type="text/css" />
    <link href="/one/Public/plugins/datatables/extensions/TableTools/css/dataTables.tableTools.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="/one/Public/dist/css/bootstrapValidator.css"/>
    <link rel="stylesheet" href="/one/Public/dist/css/tagmanager.css"/>
    <!--<link href="/one/Public/fileinput/fileinput.css" rel="stylesheet" type="text/css" />-->
    <style>
        div#video-grid li {
            padding-bottom: 10px;
        }
        #video-grid .caption{
            position: absolute;
            bottom: 15px;
            width: 97%;
            display: none;
            color: #ffffff;
        }
        .video_filter_box .panel-body {
            padding: 10px 28px;
        }
        .video_filter_box .panel-body a,.video_filter_box .panel-body label{
            margin: 10px;
        }
        .video_filter_box .panel-body ul{
            line-height: 40px;
        }
        .video_filter_box .panel-body a.active {
            color:dodgerblue !important;
        }
        .video_filter_box .panel-body a:hover {
            color: dodgerblue !important;
        }
        .video_filter_box .panel-body .searchbox{
            margin-bottom: 10px;
        }
        .video_filter_box .tm-tag a {
            padding: 0px 5px;
            font-size: small;
            font-weight: bold;
        }
        .video_filter_box .tm-tag a:hover{
            color: white !important;
            background-color: red;
        }
        .video_filter_box .filter-result  li{float: left}
    </style>

 
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body class="skin-blue-light sidebar-mini sidebar-collapse">
    <div class="wrapper">
      
                   <header class="main-header">
          <!-- Logo -->
        <a href="<?php echo C('DO_MAIN'); ?>/one/Index" class="logo">
          <!-- mini logo for sidebar mini 50x50 pixels -->
          <span class="logo-mini"><b>P</b>LH</span>
          <!-- logo for regular state and mobile devices -->
          <span class="logo-lg"><b>Phalanx</b>Holding</span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top" role="navigation">
          <!-- Sidebar toggle button-->
          <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
          </a>
          <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <?php if($clear_cache_btn): ?>
                <li class="list-langs"><a href="javascript:;" title="<?php echo (L("Update")); ?>" id="clear_cache_btn"><i class="fa fa-refresh"></i></a></li>
                <?php endif; ?>
                <li class="dropdown list-langs" style="position: relative">
                    <a href="/one/Link/link"  style="padding: 9px;">
                        <img src="/one/Public/img/favs-icon.png" style="max-width: 32px" title="<?php echo (L("Common Link")); ?>"/>
                        <span class="hidden-xs hidden-sm"><?php echo (L("Common Link")); ?></span>
                    </a>
                </li>

                <li class="dropdown list-langs">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <?php
 $langSet = cookie('think_language'); if (strtolower($langSet) == 'zh-cn') { ?>
                        <div class="flag flags-china pull-left"></div>&nbsp;<span class="hidden-xs">中文</span>
                    <?php
 } else { ?>
                        <div class="flag flags-american pull-left"></div>&nbsp;<span class="hidden-xs">English</span>
                   <?php
 } ?>
                    </a>
                    <ul class="dropdown-menu langs ">
                        <li ><a href="?l=zh-cn" class="list-langs clearfix"><div class="flag flags-china col-xs-6 col-md-6"></div><span class=" col-xs-6 col-md-6 text-black">中文</span></a> </li>
                        <li ><a href="?l=en-us" class="list-langs clearfix"><div class="flag flags-american col-xs-6 col-md-6"></div><span class="col-xs-6 col-md-6 text-black" >English</span></a></li>
                    </ul>
                </li>
              <!-- User Account: style can be found in dropdown.less -->
              <?php  $avatar == ''?$avatar = '/one/Public/dist/img/avatar5.png':$avatar; ?>
              <li class="dropdown user user-menu">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                  <img src="<?php echo ($avatar); ?>" class="user-image" alt="User Image"/>
                  <span class="hidden-xs"><?php echo getUserName(); ?></span>
                </a>
                <ul class="dropdown-menu">
                  <!-- User image -->
                  <li class="user-header">
                    <img src="<?php echo ($avatar); ?>" class="img-circle" alt="User Image" />
                    <p>
                      <?php echo getUserName(); ?> -  <?php echo getUserName('','nickname'); ?>
                    </p>
                  </li>
                  <li class="user-footer">
                    <div class="pull-left">
                      <a href="/one/Index/editProfile" class="btn btn-default btn-flat"><?php echo (L("Profile")); ?></a>
                        <!-- Profile-->
                    </div>
                    <div class="pull-right">
                      <a href="/one/Public/logout" class="btn btn-default btn-flat"><?php echo (L("Sign out")); ?></a>
                    </div>
                  </li>
                </ul>
              </li>
              <!-- Control Sidebar Toggle Button -->
              <!--<li>-->
                <!--<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>-->
              <!--</li>-->
            </ul>
          </div>
        </nav>
      </header>
      
      
               <!-- Left side column. contains the logo and sidebar -->
      <aside class="main-sidebar ">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
          <!-- Sidebar user panel -->
          <div class="user-panel">
            <div class="pull-left image">
              <img src="<?php echo ($avatar); ?>" class="img-circle" alt="User Image" />
            </div>
            <div class="pull-left info ">
              <p><?php echo getUserName(); ?></p>

              <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
            </div>
          </div>
          <!-- sidebar menu: : style can be found in sidebar.less -->
          <ul class="sidebar-menu">
            <li class="header">MAIN NAVIGATION</li>
              <?php if(is_array($groups)): $i = 0; $__LIST__ = $groups;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$group): $mod = ($i % 2 );++$i;?><li class="treeview <?php ?>  active <?php ?>">
                      <a href="#">
                          <i class="<?php echo $group['icon']==''? 'fa fa-th':$group['icon']; ?>"></i> <span><?php echo L($group['title']); ?></span>
                          <i class="fa fa-angle-left pull-right"></i>
                      </a>
                      <ul class="treeview-menu">
                          <?php if(is_array($menu[$group['id']])): $i = 0; $__LIST__ = $menu[$group['id']];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i; if(($item['access']) == "1"): if(($item["level"]) == "3"): ?><li class=" <?php if ($item['name'] == $currunt_note) : ?> active <?php endif;?>">
                                          <a href="/one/<?php echo ($parents[$item['pid']]['name']); ?>/<?php echo ($item['name']); ?>" ><i class="fa fa-circle-o"></i><?php echo L($item['title']) ?></a>
                                      </li>
                                      <?php else: ?>
                                      <li class=" <?php if ($item['name'] == $currunt_note) : ?> active <?php endif;?>">
                                        <?php $color_arr = array('red','yellow','aqua','square','green','orange'); ?>
                                          <a href="/one/<?php echo ($item['name']); ?>" ><i class="fa fa-circle-o text-<?php echo $color_arr[rand(0,5)] ?>"></i><?php echo L($item['title']) ?></a>
                                      </li><?php endif; endif; endforeach; endif; else: echo "" ;endif; ?>
                      </ul>
                  </li><?php endforeach; endif; else: echo "" ;endif; ?>
          </ul>
        </section>
        <!-- /.sidebar -->
      </aside>
      
      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
          
            <section class="content-header">
                    <!--<h1>-->
                        <!--<?php echo getNodeName($currunt_note); ?>-->
                        <!--<small>Control panel</small>-->
                    <!--</h1>-->
                    <div style="margin:0px 15px;">
                        <ol class="breadcrumb " style="margin: 0">
                            <li><a href="<?php echo C('DO_MAIN'); ?>/one/Index" title="<?php echo (L("Index")); ?>"><i class="fa fa-dashboard"></i> One </a></li>
                            <li class="active"><a href="/one/Video"><?php echo L($currunt_note); ?></a></li>
                        </ol>
                    </div>

            </section>
        
        <section class="content">
            <div class="alert alert-dismissable alert-success" id="top-alert" style="display:none">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <h4> <div class="alert-title"></div></h4><div class="alert-content"></div>
            </div>

            
    <section class="content">

        <div class="panel panel-primary search-form video_filter_box "  <?php if($view == 'video-list'): ?>style="display: none"<?php endif; ?>>
            <div class="panel-heading clearfix" style="  padding: 7px 15px;">
                <div class="col-md-1">
                    <label><?php echo (L("Filter")); ?></label>
                </div>
                <div class="col-md-11">
                <!--<?php if ($_SESSION['category_id'] || $_SESSION['video_label'] || $_SESSION['main_people'] || $_SESSION['search_data']): ?>-->
                    <!--<span class="pull-left"><?php echo (L("Filter Data")); ?>:&nbsp;&nbsp;</span>-->
                <!--<?php endif; ?>-->
                <ul class="list-unstyled filter-result">
                    <?php if ($_SESSION['search_data']): ?>
                    <li>
                        <span class="tm-tag no-padding" style="margin: 0 10px" ><?php echo (L("KeyWord")); ?>:<span class="text-red"><?php echo (getOptionsLabel($_SESSION['search_data'], $categorys)); ?></span><a  href="/one/Video/index/search_data/clear"  class="text-red">x</a></span>
                    </li>
                    <?php endif; ?>
                    <?php if ($_SESSION['category_id']): ?>
                        <li>
                            <span class="tm-tag no-padding" style="margin: 0 10px" ><?php echo (L("Category")); ?>:<span class="text-red"><?php echo (getOptionsLabel($_SESSION['category_id'], $categorys)); ?></span><a  href="/one/Video/index/category_id/all"  class="text-red">x</a></span>
                        </li>
                    <?php endif; ?>
                    <?php if ($_SESSION['video_label']): ?>
                    <li>
                        <span class="tm-tag no-padding" style="margin: 0 10px" ><?php echo (L("Lable")); ?>:<span class="text-red"><?php echo ($_SESSION['video_label']); ?></span><a  href="/one/Video/index/attr_id/1" class="text-red" >x</a></span>
                    </li>
                    <?php endif; ?>
                    <?php if ($_SESSION['main_people']): ?>
                    <li>
                        <span class="tm-tag no-padding" style="margin: 0 10px"  ><?php echo (L("Main People")); ?>:<span class="text-red"><?php echo ($_SESSION['main_people']); ?></span><a  href="/one/Video/index/attr_id/2" class="text-red" >x</a></span>
                    </li>
                    <?php endif; ?>

                </ul>
                    <?php if ($_SESSION['category_id'] || $_SESSION['video_label'] || $_SESSION['main_people'] || $_SESSION['search_data']): ?>
                    &nbsp;&nbsp; <span class="pull-right"><a href="/one/Video/index/resetForm/true" style="color: #ffffff"><?php echo (L("All revoked")); ?></a></span>
                    <?php endif; ?>
                </div>
            </div>
            <div class="panel-body list-group">
                <div class="row searchbox ">
                    <div class="col-md-2 text-right hidden-xs">
                        <label><?php echo (L("KeyWord")); ?>:</label>
                    </div>
                    <div class="col-md-6 text-left">
                        <form action="/one/Video" method="post" >
                            <!--<button title="submit" type="submit" class="btn btn-primary"><?php echo (L("Search")); ?></button>-->
                            <div class="input-group">
                                <input type="text" class="form-control" autocomplete="off"  id="video_search" name="search_data" value="<?php echo ($_SESSION['search_data']); ?>" style="padding: 6px 12px;" placeholder="Search for..." data-provide="typeahead" />
                                  <span class="input-group-btn">
                                    <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                                  </span>
                            </div><!-- /input-group -->
                        </form>
                    </div>
                </div>

                <?php if (!$_SESSION['category_id'] && count($categorys)): ?>
                <div class="row hidden-xs list-group-item">
                    <div class="col-md-2 text-right">
                        <label><?php echo (L("Category")); ?>:</label>
                    </div>
                    <div class="col-md-10  text-left">
                        <ul class="list-unstyled list">
                            <!--<li class="pull-left"><a href="/one/Video/index/category_id/all" class="<?php if(!$_SESSION['category_id']): ?>active<?php endif; ?> text-black"><?php echo (L("All")); ?></a></li>-->
                            <?php if(is_array($categorys)): $i = 0; $__LIST__ = $categorys;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$cat): $mod = ($i % 2 );++$i;?><li class="pull-left"><a href="/one/Video/index/category_id/<?php echo ($cat['value']); ?>" class="<?php if($_SESSION['category_id'] == $cat['value']): ?>active<?php endif; ?> text-black"><?php echo ($cat['label']); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
                        </ul>
                    </div>
                </div>
                <?php endif; ?>

                <?php if (!$_SESSION['video_label'] && count($video_label)): ?>
                <div class="row hidden-xs list-group-item">
                    <div class="col-md-2 text-right ">
                        <label><?php echo (L("Lable")); ?>:</label>
                    </div>
                    <div class="col-md-10  text-left">
                        <ul class="list-unstyled list">
                            <!--<li class="pull-left"><a href="/one/Video/index/attr_id/1" class="<?php if(!$_SESSION['video_label']): ?>active<?php endif; ?> text-black"><?php echo (L("All")); ?></a></li>-->
                            <?php if(is_array($video_label)): $i = 0; $__LIST__ = $video_label;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v_lab): $mod = ($i % 2 );++$i;?><li class="pull-left"><a href="/one/Video/index/attr_value/<?php echo ($v_lab['attr_value']); ?>/attr_id/<?php echo ($v_lab['attr_id']); ?>" class="<?php if($_SESSION['video_label'] == $v_lab['attr_value']): ?>active<?php endif; ?> text-black"><?php echo ($v_lab['attr_value']); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
                        </ul>
                    </div>
                </div>
                <?php endif; ?>

                <?php if (!$_SESSION['main_people'] && count($main_people)): ?>
                <div class="row hidden-xs list-group-item">
                    <div class="col-md-2  text-right">
                        <label><?php echo (L("Main People")); ?>:</label>
                    </div>
                    <div class="col-md-10  text-left">
                        <ul class="list-unstyled list">
                            <!--<li class="pull-left"><a href="/one/Video/index/attr_id/2" class="<?php if(!$_SESSION['main_people']): ?>active<?php endif; ?>" style="color: #000000"><?php echo (L("All")); ?></a></li>-->
                            <?php if(is_array($main_people)): $i = 0; $__LIST__ = $main_people;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$m_people): $mod = ($i % 2 );++$i;?><li class="pull-left"><a href="/one/Video/index/attr_value/<?php echo ($m_people['attr_value']); ?>/attr_id/<?php echo ($m_people['attr_id']); ?>" class="<?php if($_SESSION['main_people'] == $m_people['attr_value']): ?>active<?php endif; ?>" style="color: #000000"><?php echo ($m_people['attr_value']); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
                        </ul>
                    </div>
                </div>
                <?php endif; ?>
            </div>
        </div>
        <div class="nav-tabs-custom">
            <ul class="nav nav-tabs pull-right <?php echo $video_role; ?>">
                <li class="video-list"><a href="#video-list" data-toggle="tab" onclick="$('.search-form').hide()"><?php echo (L("List")); ?></a></li>
                <li class="video-grid"><a href="#video-grid" data-toggle="tab" onclick="$('.search-form').show()" ><?php echo (L("Grid")); ?></a></li>
            </ul>
            <div class="tab-content no-padding">
                <!-- Morris chart - Sales -->
                <div class="tab-pane " id="video-list" >
                            <div class="box ">
                                <div class="box-body table-responsive">
                                    <table id="video-tables" class="table table-bordered table-striped">
                                        <thead>
                                            <tr>
                                                <th><?php echo (L("编号")); ?></th>
                                                <th><?php echo (L("视频标题")); ?></th>
                                                <th><?php echo (L("分类")); ?></th>
                                                <th><?php echo (L("主要人物")); ?></th>
                                                <th><?php echo (L("上传人")); ?></th>
                                                <th><?php echo (L("上传时间")); ?></th>
                                                <th><?php echo (L("操作")); ?></th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(is_array($lists)): $j = 0; $__LIST__ = $lists;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($j % 2 );++$j;?><tr data="<?php echo ($vo['id']); ?>" >
                                                    <td><?php echo ($j); ?></td>
                                                    <td>
                                                        <a href="javascript:;" data-title="video detail" data-toggle="modal" data-target="#video-detail" data="<?php echo ($vo['id']); ?>" onclick="ajaxLoadViewDetail(this)">
                                                            <i class="fa  fa-youtube-play"></i> <?php echo ($vo['title_cn']); echo ($vo['title_en']); ?>
                                                        </a>
                                                    </td>
                                                    <td><?php echo (getOptionsLabel($vo['category_id'], $categorys)); ?></td>
                                                    <td>
                                                        <?php
 $peoples = getMainPeople($vo['id']); foreach($peoples as $item) { echo $item.' '; } ?>
                                                    </td>
                                                    <td><?php echo ($vo['creator']); ?></td>
                                                    <td><?php echo ($vo['created_at']); ?></td>
                                                    <td>
                                                        <p data-placement="top" data-toggle="tooltip" title="Edit">
                                                            <a href="javascript:;"  url="/one/Video/edit/id/<?php echo ($vo['id']); ?>" class="ajax-callback">
                                                            <button class="btn btn-primary btn-xs"    data-title="Edit" data-toggle="modal" data-target="#edit"><span class="glyphicon  glyphicon-edit"></span> </button>
                                                            </a>
                                                        </p>
                                                    </td>
                                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                </div>
                <div class=" tab-pane  " id="video-grid">
                    <div class="box box-primary">
                        <div class="box-header"></div>
                        <div class="box-body ">
                            <ul class="list-unstyled list thumbnails">
                            <?php if (count($videolist)): ?>
                            <?php if(is_array($videolist)): $i = 0; $__LIST__ = $videolist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; if($vo['youku_url'] || $vo['youtube_url']): ?>
                                    <li class="col-md-4 col-sm-6 ">
                                        <div class="thumbnail" style="  position: relative;">
                                            <img src="<?php echo $vo['video_thumbnail']==''?'/one/Public/img/video_default.png':$vo['video_thumbnail'] ?>"
                                                 class="img-responsive thumbnail margin no-padding" style="max-height: 240px" />
                                            <div class="caption">
                                                <div class="col-md-9">
                                                    <h5 ><?php echo ($vo['title_cn']); echo ($vo['title_en']); ?></h5>
                                                </div>
                                                <div class=" col-md-3">
                                                    <a href="javascript:;" class="btn btn-primary pull-right" data-title="video detail" data-toggle="modal" backdrop="static" keyboard="false" data-target="#video-detail" data="<?php echo ($vo['id']); ?>"
                                                       onclick="ajaxLoadViewDetail(this)">Play</a>
                                                </div>
                                            </div>
                                        </div>
                                    </li>
                                 <?php endif; endforeach; endif; else: echo "" ;endif; ?>
                             <?php else: ?>
                                <li>
                                    <div class="error-page">
                                        <h2 class="headline text-yellow"> 404</h2>
                                        <div class="error-content" style="padding-top: 20px;">
                                            <h3><i class="fa fa-warning text-yellow"></i> Oops! Video not found.</h3>
                                            <p>
                                                We could not find the video you were looking for.
                                                Meanwhile, you may <a href="/one/Video/index/resetForm/true">reset form</a> or try  re search form.
                                            </p>
                                        </div><!-- /.error-content -->
                                    </div>
                                </li>
                             <?php endif; ?>
                            </ul>
                        </div>
                        <div class="box-footer">
                            <ul class="pagination pull-right" id="video_page_tools">
                                <?php echo ($page); ?>
                            </ul>
                        </div>
                    </div>
                </div>
           </div>
       </div>
        <div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="addModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="addModalLabel"><?php echo (L("添加视频信息")); ?></h4>
			</div>
            <div class="modal-body">
                <form role="form" action="/one/Video/insert" method="post" id="videoAddForm">
			        
		<div class="box-body">
			<div class="form-group">
				<label><?php echo (L("YouKu链接地址")); ?>：</label>
				<!--<input type="text" class="form-control" name="youku_url" placeholder="Enter ..." />-->
                <textarea name="youku_url" class="form-control"></textarea>
			</div>
			<div class="form-group">
				<label><?php echo (L("YouTobe链接地址")); ?>：</label>
				<!--<input type="text" class="form-control" name="youtube_url" placeholder="Enter ..." />-->
                <textarea name="youtube_url" class="form-control"></textarea>
			</div>
			<div class="form-group">
				<label><?php echo (L("视频语言")); ?>：</label>
				<SELECT name="lan">
					<option value="zh-cn">中文</option>
					<option value="en-us">英文</option>
				</SELECT>
				&nbsp;&nbsp;
				<label><?php echo (L("分类")); ?>：</label>
				<SELECT name="category_id">
                    <?php echo (renderOptions($categorys,'')); ?>
				</SELECT>
			</div>
			<div class="form-group">
				<label><?php echo (L("视频中文标题")); ?>：</label>
				<input type="text" class="form-control" name="title_cn" placeholder="Enter ..." />
			</div>
			<div class="form-group">
				<label><?php echo (L("视频英文标题")); ?>：</label>
				<input type="text" class="form-control" name="title_en" placeholder="Enter ..." />
			</div>
            <div class="form-group">
                <label><?php echo (L("视频缩略图")); ?>：</label>
                <img src="" style="display: none;max-width: 200px" class="image thumbnail video-thumbnail img-responsive"  />
                <input class="form-control" type="file" class="file form-control " name="video_thumbnail" id="file_thumbnail" data-preview-file-type="text">
            </div>
			<div class="form-group">
				<label><?php echo (L("主要人物")); ?>：</label>
                <div class="video_people_block"></div>
			</div>

			<div class="form-group">
				<label><?php echo (L("标签")); ?>：</label>
                <div class="video_tag_block"></div>
			</div>
            <div class="form-group">
                <label><?php echo (L("简介")); ?>：</label>
                <textarea name="intro" rows="3" cols="57" class="form-control"></textarea>
            </div>
		</div>
		<div class="box-footer">
			<input type="hidden" name="ajax" value="1">
			<button type="submit" class="btn btn-primary">Submit</button>
		</div>


                </form>
            </div>
		</div>
	</div>
</div>
        <div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="addModalLabel"><?php echo (L("编辑视频信息")); ?></h4>
			</div>
            <div class="modal-body">
                <form role="form" action="/one/Video/update" method="post" id="videoEditForm" name="videoEditForm">
                    <input type="hidden" class="form-control" name="id" placeholder="Enter ..." />
			        
		<div class="box-body">
			<div class="form-group">
				<label><?php echo (L("YouKu链接地址")); ?>：</label>
				<!--<input type="text" class="form-control" name="youku_url" placeholder="Enter ..." />-->
                <textarea name="youku_url" class="form-control"></textarea>
			</div>
			<div class="form-group">
				<label><?php echo (L("YouTobe链接地址")); ?>：</label>
				<!--<input type="text" class="form-control" name="youtube_url" placeholder="Enter ..." />-->
                <textarea name="youtube_url" class="form-control"></textarea>
			</div>
			<div class="form-group">
				<label><?php echo (L("视频语言")); ?>：</label>
				<SELECT name="lan">
					<option value="zh-cn">中文</option>
					<option value="en-us">英文</option>
				</SELECT>
				&nbsp;&nbsp;
				<label><?php echo (L("分类")); ?>：</label>
				<SELECT name="category_id">
                    <?php echo (renderOptions($categorys,'')); ?>
				</SELECT>
			</div>
			<div class="form-group">
				<label><?php echo (L("视频中文标题")); ?>：</label>
				<input type="text" class="form-control" name="title_cn" placeholder="Enter ..." />
			</div>
			<div class="form-group">
				<label><?php echo (L("视频英文标题")); ?>：</label>
				<input type="text" class="form-control" name="title_en" placeholder="Enter ..." />
			</div>
            <div class="form-group">
                <label><?php echo (L("视频缩略图")); ?>：</label>
                <img src="" style="display: none;max-width: 200px" class="image thumbnail video-thumbnail img-responsive"  />
                <input class="form-control" type="file" class="file form-control " name="video_thumbnail" id="file_thumbnail" data-preview-file-type="text">
            </div>
			<div class="form-group">
				<label><?php echo (L("主要人物")); ?>：</label>
                <div class="video_people_block"></div>
			</div>

			<div class="form-group">
				<label><?php echo (L("标签")); ?>：</label>
                <div class="video_tag_block"></div>
			</div>
            <div class="form-group">
                <label><?php echo (L("简介")); ?>：</label>
                <textarea name="intro" rows="3" cols="57" class="form-control"></textarea>
            </div>
		</div>
		<div class="box-footer">
			<input type="hidden" name="ajax" value="1">
			<button type="submit" class="btn btn-primary">Submit</button>
		</div>


                </form>
            </div>
		</div>
	</div>
</div>
        <div class="modal fade" id="video-detail" tabindex="-1" role="dialog" aria-labelledby="viewModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" >&times;</button>
                <h4 class="modal-title" id="viewModalLabel"><?php echo (L("视频详情")); ?>  &nbsp;&nbsp;<small class="text-danger" style="font-size: 10px"><?php echo (L("China, please see YouTube video VPN")); ?></small></h4>

            </div>
            <div class="modal-body ">
                <div class="row">
                    <div class="col-md-12">
                        <div class="embed-responsive embed-responsive-16by9">
                            <iframe  height="auto"  src="" frameborder=0 allowfullscreen  class="detail detail-video"></iframe>
                            <div id="no-find-video" class="text-center"></div>
                        </div>
                        <input type="hidden" value="" class="video-youku" />
                        <input type="hidden" value="" class="video-youtube" />
                    </div>
                </div>
                <br/>
                <div class="row">
                    <div class="nav-tabs-custom">
                        <ul class="nav nav-tabs pull-right">
                            <li class="pull-left active"><a href="#toggle_info"  data-toggle="tab"><?php echo (L("Basic information")); ?></a></li>
                            <li class="pull-left"><a href="#toggle_share"  data-toggle="tab"><?php echo (L("Share")); ?></a></li>
                            <li class="pull-right"><a href="javascript:;" class="toggle-video no-padding"><i class="fa fa-youtube-play" title="YouTuBe"></i></a></li>
                        </ul>
                        <div class="tab-content no-padding ">
                            <div class=" tab-pane active" id="toggle_info">
                                <table  class="table table-bordered table-striped dataTable ">
                                    <tbody>
                                        <tr>
                                            <td class="col-md-3 col-xs-6">  <label><?php echo (L("title")); ?>：</label> </td>
                                            <td class="col-md-9 col-xs-6">  <span class="title_name"></span> </td>
                                        </tr>
                                        <tr>
                                            <td class="col-md-3 col-xs-6">
                                                <label><?php echo (L("creator")); ?>：</label>
                                            </td>
                                            <td class="col-md-9 col-xs-6">
                                                <span class="creator"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="col-md-3 col-xs-6">
                                                <label><?php echo (L("created_at")); ?>：</label>
                                            </td>
                                            <td class="col-md-9 col-xs-6">
                                                <span class="created_at"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="col-md-3 col-xs-6">
                                                <label><?php echo (L("category")); ?>：</label>
                                            </td>
                                            <td class="col-md-9">
                                                <span class="category"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="col-md-3 col-xs-6">
                                                <label><?php echo (L("people")); ?>：</label>
                                            </td>
                                            <td class="col-md-9 col-xs-6">
                                                <span class="people"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="col-md-3 col-xs-6"><label><?php echo (L("tag")); ?>：</label></td>
                                            <td class="col-md-9 col-xs-6">
                                                <span class="tag"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="col-md-3 col-xs-6">
                                                <label><?php echo (L("intro")); ?>：</label>
                                            </td>
                                            <td class="col-md-9 col-xs-6">
                                                <span class="intro"></span>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class=" share-panel tab-pane" id="toggle_share">
                                <form role="form" action="/one/Video/shareVideoByEmail" method="post" id="videoViewForm" name="videoViewForm">
                                    <div class="box">
                                        <div class="box-body">
                                            <div class="form-group">
                                                <label><?php echo (L("title")); ?>：</label>
                                                <input type="text" class="form-control share_title" name="share_title" placeholder="Enter ..." />
                                                <input type="hidden" class="form-control share_link" readonly="true" name="share_link" placeholder="Enter ..." />
                                            </div>
                                            <div class="form-group">
                                                <div class="row">
                                                    <div class="col-md-6 ">
                                                        <label><?php echo (L("password")); ?>：</label>
                                                        <input type="text" class="form-control" name="share_password" placeholder="Enter ..." />
                                                    </div>
                                                    <div class="col-md-6 ">
                                                        <label><?php echo (L("Email")); ?>：</label>
                                                        <input type="text" name="email" class="form-control  " />
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label><?php echo (L("Message")); ?>：</label>
                                                <textarea name="message" rows="2" cols="57" class="form-control"></textarea>
                                            </div>
                                        </div>
                                        <div class="box-footer">
                                            <input type="hidden" name="ajax" value="1">
                                            <button type="submit" class="btn btn-primary pull-right"><?php echo (L("Send Email")); ?></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


    </section><!-- /.content -->



        </section>

      </div><!-- /.content-wrapper -->
      
          
<footer class="main-footer">
  <div class="pull-right hidden-xs">
    <b>Version</b> 1.0
  </div>
  <strong>Copyright &copy; 2015 <a href="#">Phalanx Holding</a>.</strong> All rights reserved.
</footer>
      <!---->
      <!--&lt;!&ndash; Control Sidebar &ndash;&gt;      -->
      <!--<aside class="control-sidebar control-sidebar-dark">                -->
        <!--&lt;!&ndash; Create the tabs &ndash;&gt;-->
        <!--<ul class="nav nav-tabs nav-justified control-sidebar-tabs">-->
          <!--<li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>-->
          <!---->
          <!--<li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>-->
        <!--</ul>-->
        <!--&lt;!&ndash; Tab panes &ndash;&gt;-->
        <!--<div class="tab-content">-->
          <!--&lt;!&ndash; Home tab content &ndash;&gt;-->
          <!--<div class="tab-pane" id="control-sidebar-home-tab">-->
            <!--<h3 class="control-sidebar-heading">Recent Activity</h3>-->
            <!--<ul class='control-sidebar-menu'>-->
              <!--<li>-->
                <!--<a href='javascript::;'>-->
                  <!--<i class="menu-icon fa fa-birthday-cake bg-red"></i>-->
                  <!--<div class="menu-info">-->
                    <!--<h4 class="control-sidebar-subheading">Langdon's Birthday</h4>-->
                    <!--<p>Will be 23 on April 24th</p>-->
                  <!--</div>-->
                <!--</a>-->
              <!--</li>-->
              <!--<li>-->
                <!--<a href='javascript::;'>-->
                  <!--<i class="menu-icon fa fa-user bg-yellow"></i>-->
                  <!--<div class="menu-info">-->
                    <!--<h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>-->
                    <!--<p>New phone +1(800)555-1234</p>-->
                  <!--</div>-->
                <!--</a>-->
              <!--</li>-->
              <!--<li>-->
                <!--<a href='javascript::;'>-->
                  <!--<i class="menu-icon fa fa-envelope-o bg-light-blue"></i>-->
                  <!--<div class="menu-info">-->
                    <!--<h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>-->
                    <!--<p>nora@example.com</p>-->
                  <!--</div>-->
                <!--</a>-->
              <!--</li>-->
              <!--<li>-->
                <!--<a href='javascript::;'>-->
                  <!--<i class="menu-icon fa fa-file-code-o bg-green"></i>-->
                  <!--<div class="menu-info">-->
                    <!--<h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>-->
                    <!--<p>Execution time 5 seconds</p>-->
                  <!--</div>-->
                <!--</a>-->
              <!--</li>-->
            <!--</ul>&lt;!&ndash; /.control-sidebar-menu &ndash;&gt;-->

            <!--<h3 class="control-sidebar-heading">Tasks Progress</h3> -->
            <!--<ul class='control-sidebar-menu'>-->
              <!--<li>-->
                <!--<a href='javascript::;'>               -->
                  <!--<h4 class="control-sidebar-subheading">-->
                    <!--Custom Template Design-->
                    <!--<span class="label label-danger pull-right">70%</span>-->
                  <!--</h4>-->
                  <!--<div class="progress progress-xxs">-->
                    <!--<div class="progress-bar progress-bar-danger" style="width: 70%"></div>-->
                  <!--</div>                                    -->
                <!--</a>-->
              <!--</li> -->
              <!--<li>-->
                <!--<a href='javascript::;'>               -->
                  <!--<h4 class="control-sidebar-subheading">-->
                    <!--Update Resume-->
                    <!--<span class="label label-success pull-right">95%</span>-->
                  <!--</h4>-->
                  <!--<div class="progress progress-xxs">-->
                    <!--<div class="progress-bar progress-bar-success" style="width: 95%"></div>-->
                  <!--</div>                                    -->
                <!--</a>-->
              <!--</li> -->
              <!--<li>-->
                <!--<a href='javascript::;'>               -->
                  <!--<h4 class="control-sidebar-subheading">-->
                    <!--Laravel Integration-->
                    <!--<span class="label label-waring pull-right">50%</span>-->
                  <!--</h4>-->
                  <!--<div class="progress progress-xxs">-->
                    <!--<div class="progress-bar progress-bar-warning" style="width: 50%"></div>-->
                  <!--</div>                                    -->
                <!--</a>-->
              <!--</li> -->
              <!--<li>-->
                <!--<a href='javascript::;'>               -->
                  <!--<h4 class="control-sidebar-subheading">-->
                    <!--Back End Framework-->
                    <!--<span class="label label-primary pull-right">68%</span>-->
                  <!--</h4>-->
                  <!--<div class="progress progress-xxs">-->
                    <!--<div class="progress-bar progress-bar-primary" style="width: 68%"></div>-->
                  <!--</div>                                    -->
                <!--</a>-->
              <!--</li>               -->
            <!--</ul>&lt;!&ndash; /.control-sidebar-menu &ndash;&gt;         -->

          <!--</div>&lt;!&ndash; /.tab-pane &ndash;&gt;-->
          <!--&lt;!&ndash; Stats tab content &ndash;&gt;-->
          <!--<div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>&lt;!&ndash; /.tab-pane &ndash;&gt;-->
          <!--&lt;!&ndash; Settings tab content &ndash;&gt;-->
          <!--<div class="tab-pane" id="control-sidebar-settings-tab">            -->
            <!--<form method="post">-->
              <!--<h3 class="control-sidebar-heading">General Settings</h3>-->
              <!--<div class="form-group">-->
                <!--<label class="control-sidebar-subheading">-->
                  <!--Report panel usage-->
                  <!--<input type="checkbox" class="pull-right" checked />-->
                <!--</label>-->
                <!--<p>-->
                  <!--Some information about this general settings option-->
                <!--</p>-->
              <!--</div>&lt;!&ndash; /.form-group &ndash;&gt;-->

              <!--<div class="form-group">-->
                <!--<label class="control-sidebar-subheading">-->
                  <!--Allow mail redirect-->
                  <!--<input type="checkbox" class="pull-right" checked />-->
                <!--</label>-->
                <!--<p>-->
                  <!--Other sets of options are available-->
                <!--</p>-->
              <!--</div>&lt;!&ndash; /.form-group &ndash;&gt;-->

              <!--<div class="form-group">-->
                <!--<label class="control-sidebar-subheading">-->
                  <!--Expose author name in posts-->
                  <!--<input type="checkbox" class="pull-right" checked />-->
                <!--</label>-->
                <!--<p>-->
                  <!--Allow the user to show his name in blog posts-->
                <!--</p>-->
              <!--</div>&lt;!&ndash; /.form-group &ndash;&gt;-->

              <!--<h3 class="control-sidebar-heading">Chat Settings</h3>-->

              <!--<div class="form-group">-->
                <!--<label class="control-sidebar-subheading">-->
                  <!--Show me as online-->
                  <!--<input type="checkbox" class="pull-right" checked />-->
                <!--</label>                -->
              <!--</div>&lt;!&ndash; /.form-group &ndash;&gt;-->

              <!--<div class="form-group">-->
                <!--<label class="control-sidebar-subheading">-->
                  <!--Turn off notifications-->
                  <!--<input type="checkbox" class="pull-right" />-->
                <!--</label>                -->
              <!--</div>&lt;!&ndash; /.form-group &ndash;&gt;-->

              <!--<div class="form-group">-->
                <!--<label class="control-sidebar-subheading">-->
                  <!--Delete chat history-->
                  <!--<a href="javascript::;" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>-->
                <!--</label>                -->
              <!--</div>&lt;!&ndash; /.form-group &ndash;&gt;-->
            <!--</form>-->
          <!--</div>&lt;!&ndash; /.tab-pane &ndash;&gt;-->
        <!--</div>-->
      <!--</aside>&lt;!&ndash; /.control-sidebar &ndash;&gt;-->
      <!-- Add the sidebar's background. This div must be placed
           immediately after the control sidebar -->
      <div class='control-sidebar-bg'></div>
</div><!-- ./wrapper -->

      

     <!-- jQuery 2.1.4 -->
    <script src="/one/Public/plugins/jQuery/jQuery-2.1.4.min.js"></script>

    <!-- ajax Jquery form -->
    <script src="/one/Public/dist/js/jquery.form.js" type="text/javascript"></script>
    <!-- custom extends js -->
    <script src="/one/Public/dist/js/custom.extends.js" type="text/javascript"></script>
    <!-- jQuery UI 1.11.2 -->
    <script src="/one/Public/plugins/jQueryUI/jquery-ui.min.js" type="text/javascript"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
      $.widget.bridge('uibutton', $.ui.button);
    </script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="/one/Public/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <!-- Slimscroll -->
    <script src="/one/Public/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <!-- AdminLTE App -->
    <script src="/one/Public/dist/js/app.min.js" type="text/javascript"></script>

    <!-- AdminLTE for demo purposes -->
    <script src="/one/Public/dist/js/demo.js" type="text/javascript"></script>

    <!-- Bootstrap WYSIHTML5 -->
    <script src="/one/Public/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>

    <!--bootstrap Validator-->
    <script src="/one/Public/dist/js/bootstrapValidator.js" type="text/javascript"></script>
    <script src="/one/Public/dist/js/language/zh_CN.js" type="text/javascript"></script>

    <!--<script type="text/javascript" src="/one/Public/dist/js/jquery.touchSwipe.min.js"></script>-->

    

    <script src="/one/Public/plugins/datatables/jquery.dataTables.min.js" type="text/javascript"></script>
    <script src="/one/Public/plugins/datatables/dataTables.bootstrap.min.js" type="text/javascript"></script>
    <script src="/one/Public/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.min.js" type="text/javascript"></script>
    <script src="/one/Public/dist/js/bootstrapValidator.js" type="text/javascript"></script>
    <script src="/one/Public/dist/js/language/zh_CN.js" type="text/javascript"></script>
    <script src="/one/Public/dist/js/validator.js" type="text/javascript"></script>
    <script src="/one/Public/dist/js/bootstrap-typeahead.js" type="text/javascript"></script>
    <script src="/one/Public/dist/js/underscore-min.js" type="text/javascript"></script>
    <script src="/one/Public/dist/js/tagmanager.js" type="text/javascript"></script>

    <script type="text/javascript">
        var nofindImg = '<img src="/one/Public/img/exclamation.png"  class="img-responsive" style=" margin: 0 auto;" />';
        $(function () {
            iniDataTable("#video-tables",'iniVideoDetail()','/one/Video');
            iniAjaxFormDialog('#videoAddForm','#add');
            iniAjaxFormDialog('#videoEditForm','#edit');
            iniAjaxFormDialog('#videoViewForm','#video-detail',true);
            Validator('videoViewForm');

        });

        function iniVideoDetail() {
            $('.video-thumbnail').hide().attr('src','');
            iniLable('');
        }

        /**
         *  bootstarp
         *  autocomplete
         */
            $.fn.typeahead.Constructor.prototype.blur = function () {
                var that = this;
                setTimeout(function () {
                    that.hide()
                }, 250);
            };

            var searchQueryObject = {
                queryFn: function (object) {
                    object.typeahead({
                        source: function (query, process) {
                            var parameter = {query: query};
                            $.post('/one/Video/ajaxGetAttribute', parameter, function (data) {
                                process(eval(data));
                            });
                        },

                        matcher: function (item) {
                            return true;
                        },

                        highlighter: function (data) {
                            return '==> ' + data + ' <==';
                        },

                        updater: function (data) {
                            return data;
                        }
                    });
                }
            };
            searchQueryObject.queryFn($('#video_search'));


        //编辑事件的回调函数
        $('.ajax-callback').bind('click',function(){
            ajaxObject.ajaxCallBackFn(this,function(result){
                var data = $.parseJSON(result);
                videoEditForm.id.value = data.id;
                videoEditForm.youku_url.value = data.youku_url;
                videoEditForm.youtube_url.value = data.youtube_url;
                videoEditForm.title_cn.value = data.title_cn;
                videoEditForm.title_en.value = data.title_en;
                videoEditForm.intro.value = data.intro;
                iniLable(data);

                $('.video-thumbnail').hide();
                if(data.video_thumbnail){
                    $('.video-thumbnail').show().attr('src',data.video_thumbnail);
                }
                var lans = videoEditForm.lan.options;
                for(var i in lans){
                    if(lans[i].value == data.lan){
                        lans[i].defaultSelected = true;
                        lans[i].selected = true;
                    }
                }
                var cats = videoEditForm.category_id.options;
                for(var j in cats){
                    if(cats[j].value == data.category_id){
                        cats[j].defaultSelected = true;
                        cats[j].selected = true;
                    }
                }

            });
        });

        /**
         * 初始化 video tag数据
         * @param data
         */
        function iniLable(data) {
            var tagDiv = $('.video_tag_block');
            var peopleDiv = $('.video_people_block');
            var tags = data == ''?'':data.tag.split(' ');
            var peoples = data == ''?'':data.people.split(' ');
            tagDiv.html('');peopleDiv.html('');
            searchQueryObject.queryFn(tagDiv.append(' <input type="text" class="form-control tag-input" autocomplete="off" id="addNewTagInput"  placeholder="请输入标签，使用回车键来添加，删除键删除标签" />')
                    .find("#addNewTagInput").tagsManager({
                        prefilled: tags,
                        AjaxPush: '/one/Video/ajaxPushLabel',
                        maxTags:10,
                        AjaxPushAllTags: true,
                        AjaxPushParameters: { 'video_id':data.id,'attr_id':1 }
             }));
            searchQueryObject.queryFn(peopleDiv.append(' <input type="text" class="form-control tag-input" autocomplete="off" id="addNewPeopleInput"  placeholder="请输入标签，使用回车键来添加，删除键删除标签" />')
                    .find("#addNewPeopleInput").tagsManager({
                        prefilled: peoples,
                        AjaxPush : '/one/Video/ajaxPushLabel',
                        maxTags  : 10,
                        AjaxPushAllTags :true,
                        AjaxPushParameters :{ 'video_id':data.id,'attr_id':2 }
            }));
        }

        $(function(){


            $(".tag-input").on('tm:afterPush', function(e, tag) {
                alert(tag + " was pushed!");
            });

            $('#<?php  echo $view ?>').addClass('active');
            $('.<?php  echo $view ?>').addClass('active');
            //视频详情 切换平台事件
            $('.toggle-video').bind('click',function(){
                var video = $('.detail.detail-video');
                var youtube_url = $('.video-youtube').val();
                var youku_url = $('.video-youku').val();
                $('#no-find-video').html('');
                if (video.attr('lan') == 'zh-cn'){
                    if(youtube_url == ''){
                        $('#no-find-video').html(nofindImg);
                    }
                    video.attr('src',youtube_url).attr('lan','en-us');
                    $('#toggle_share').find('.share_link').val(youtube_url);
                    $(this).html('<img src="/one/Public/img/Yk-logo.png" width="65px" title="YouKu"  />');
                } else {
                    if(youku_url == ''){
                        $('#no-find-video').html(nofindImg);
                    }
                    video.attr('src', youku_url).attr('lan', 'zh-cn');
                    $('#toggle_share').find('.share_link').val(youku_url);

                    $(this).html('<img src="/one/Public/img/YouTube-logo.png" width="65px" title="YouTuBe"  />');
                }

            });

        });
        //分类存入js变量
        var categorys = new Array();
        <?php foreach($categorys as $item){ ?>
            categorys[<?php echo $item['value'] ?>] = '<?php echo $item["label"] ?>';
        <?php } ?>

//        $('#video-detail').modal({backdrop: 'static', keyboard: false});
//        $('#video-detail').modal('hide');
        //ajax 加载视频详情
        function ajaxLoadViewDetail(e) {
            var id = $(e).attr('data');
            $.post('/one/Video/viewDetail',{
                id:id
            },function(result){
                videoViewForm.reset();
                var data = $.parseJSON(result);
                var lan = '<?php echo LANG_SET ?>';
                var info = $('#toggle_info');
                var share = $('#toggle_share');
                var title = '';
                $('#no-find-video').html('');
                if (lan == 'zh-cn'){
                    $('.detail.detail-video').attr('src',data.youku_url).attr('lan','zh-cn');
                    title = data.title_cn;
                    share.find('.share_link').val(data.youku_url);
                    $('.toggle-video').html('<img src="/one/Public/img/YouTube-logo.png" width="65px" title="YouTuBe" />');
                    if (!data.youku_url){
                        $('#no-find-video').html(nofindImg);
                    }
                }else {
                    title = data.title_en;
                    $('.detail.detail-video').attr('src',data.youtube_url).attr('lan','en-us');
                    share.find('.share_link').val(data.youtube_url);
                    $('.toggle-video').html('<img src="/one/Public/img/Yk-logo.png" width="65px" title="YouKu" />');
                    if (!data.youtube_url){
                        $('#no-find-video').html(nofindImg);
                    }
                }
                $('.video-youtube').val(data.youtube_url);

                $('.video-youku').val(data.youku_url);

                info.find('.title_name').html(title);
                share.find('.share_title').val(title);
                share.find('.video_id').val(data.id);

                info.find('.intro').html(data.intro);
                info.find('.people').html(data.people);
                info.find('.tag').html(data.tag);
                info.find('.created_at').html(data.created_at);
                info.find('.category').html(categorys[data.category_id]);
                info.find('.creator').html(data.creator);
            });
        }
        //鼠标移动到视频缩略图 显示播放按钮
        $('#video-grid .thumbnails .thumbnail').hover(function(){
            $(this).find('.caption').toggle();
        });

        //禁用Enter键表单自动提交
        document.onkeydown = function(event) {
            var target, code, tag;
            if (!event) {
                event = window.event; //针对ie浏览器
                target = event.srcElement;
                code = event.keyCode;
                if (code == 13) {
                    tag = target.tagName;
                    if (tag == "TEXTAREA") { return true; }
                    else { return false; }
                }
            }
            else {
                target = event.target; //针对遵循w3c标准的浏览器，如Firefox
                code = event.keyCode;
                if (code == 13) {
                    tag = target.tagName;
                    if (tag == "INPUT") { return false; }
                    else { return true; }
                }
            }
        };
    </script>


    <script src="/one/Public/ie/jquery.placeholder.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
        // Invoke the plugin
        $('input, textarea').placeholder();
    });
    </script>
    </div>
    </body>
</html>